package com.flyan.game.motafx.core.script

import com.flyan.game.motafx.core.map.FloorMap
import com.flyan.game.motafx.core.map.TowerMap
import com.flyan.game.motafx.core.util.console.ConsoleUtils

/**
 * 创建地图脚本
 *
 * @author flyan
 * @version 1.0
 * @email flyan_by_chenu@sina.com
 * @since 2025/2/10
 */
class CreateTowerMapScript {

    TowerMap creat(int floorNumber) {
        var towerMap = new TowerMap();
        for (int i = 0; i <= floorNumber; i++) {
            towerMap.addFloor(new FloorMap("map/50/%df.json".formatted(i)));
        }
        towerMap.setCurrentFloorNumber(1);
        towerMap.drawMap();

        ConsoleUtils.println("使用groovy脚本创建地图成功！")

        return towerMap;
    }

}
